/**
 * BrickView
 * 
 * Version 1.0
 *
 * Nov 29th, 2009
 * 
 * Copyright (c) 2009 Duc Nguyen
 */

import java.util.Observer;
import javax.swing.JPanel;
/**
 * this abstract class provides generic methods for concrete instances of brick view,
 * such as a reference to the model
 * @author Duc Nguyen
 *
 */

public abstract class BrickView extends JPanel implements Observer {

	private static final long serialVersionUID = 1L;
	/** the model this view refers to */
	private BrickModel model;
	/** rectangular x wide value of the box */
	private double rectX;
	/** rectangular y wide value of the box */
	private double rectY;
	
	/** describes the top left x coordinate of the rectangle */
	public final double TOP_X = 10;
	/** describes the top left y coordinate of the rectangle */
	public final double TOP_Y = 10;
	
	/**
	 * Constructor
	 * @param model		the model this refers to
	 */
	public BrickView(BrickModel model){
		this.model = model;
		model.addObserver(this);
	}
	
	/**
	 * @return the model
	 */
	public BrickModel getModel(){
		return this.model;
	}

	/**
	 * @return the x length of the rectangle
	 */
	public double getRectX() {
		return rectX;
	}

	/**
	 * @param x the length value of the rectangle
	 */
	public void setRectX(double x) {
		this.rectX = x;
	}

	/**
	 * @return	the y length of the rectangle
	 */
	public double getRectY() {
		return rectY;
	}

	/**
	 * @param the y length of the rectangle
	 */
	public void setRectY(double y) {
		this.rectY = y;
	}


}
